<?php
Class Membership_Model extends CI_Model
{
   function validate()
   {
       $username = $this->input->post('username');
       $password = $this->input->post('password');
       $this -> db -> select('username, password,type');
       $this -> db -> where('username', $username);
       $this -> db -> where('password', MD5($password));
       $this -> db -> limit(1);
       $query = $this -> db -> get('users');

      if($query -> num_rows() == 1)
      {
          return $query;
      }
      else
      {
          return false;
      }
 }
}
?>